package Package.Example.Text1;

public class SellTicket implements Runnable {
    private int tickets = 100;

    @Override
    public void run() {
        while (true) {
            if (tickets > 0) {
                tickets--;
                System.out.println("低" + (100 - tickets) + "张票已经s出售");
            } else {
                System.out.println("票卖完了");
            }
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
